<template>
  <div class="operation">
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>数据库管理
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="$router.go(0)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe662;</span>刷新
          </el-button>
        </div>
      </div>
    </div>
    <div class="search-header">
      <div class="left-title">
        <p class="left-text">
          <span class="iconfont">&#xe61e;</span>
          {{title}}
        </p>
        <div class="right">
          <button v-show="outputList" style="width:80px;

        height:30px">开始备份</button>
        </div>
      </div>
    </div>

    <div class="table">
      <el-table ref="multipleTable" :data="info" tooltip-effect="dark" border>
        <el-table-column label="备份文件名" align="center" prop="fileName"></el-table-column>
        <el-table-column label="大小（字节）" align="center" prop="file_size"></el-table-column>
        <el-table-column label="备份时间" align="center">
          <template slot-scope="scope">
            {{scope.row.createDate | dateFilter}}
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <span style="color:#43c2bd;cursor: pointer;">删除</span>
        </el-table-column>
      </el-table>
    </div>

    <!-- 分页功能 -->
    <div class="component-paging" v-if="info.length>0">
      <div class="table-bottom">
        <div class="bottom-left">
        </div>
        <div class="paging">
          <div class="paging-left">
            <p>
              共
              <span>{{Math.ceil(total/pageSize)}}</span> 页/
              <span>{{total}}</span> 条数据
            </p>
          </div>
          <el-pagination
            background
            @size-change="SizeChange($event,dataInit,currentPage,pageSize)"
            @current-change="CurrentChange($event,dataInit,currentPage,pageSize)"
            :current-page="currentPage"
            :page-sizes="[10, 20, 30]"
            :page-size="pageSize"
            layout="sizes, prev, pager, next, jumper"
            :total="total"
          ></el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>


<script>
export default {
  name: "dataList",
  data() {
    return {
      result: true,
      advanced: true,
      value1: "",
      formInline: {
        classify: ""
      },
      title: "数据库管理",
      outputList: true,
      // 显示条数的data
      info: [],
      // 数据总条数
      total: 0,
      // 每页显示数据的条数
      pageSize: 10,
      // 当前显示的页面页码
      currentPage: 1
    };
  },
  mounted(){
    this.dataInit();
  },
  methods: {
    //查询数据列表
    dataInit(){
        console.log(11)
      let that = this;
      let suCb = function(res){
        that.total = res.data.data.total;
        that.info = res.data.data.list;
        console.log(res.data)
      }
      let erCb = function(res){
        console.log(33)
        console.log(res)
      }
      let postData = {
        pn:this.currentPage,
        psize:this.pageSize
      }
      let palyParam = {
        url: "/api/web/sysFile/findAllSysFile",
        methods:'get',
        data: postData,
        success: suCb,
        error: erCb,
      }
      that.$https(palyParam)
    },
  }
};
</script>
<style scoped>
.search-header {
  width: 1100px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
  border-bottom: 0;
}

.search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.search-header .left-title .left-text {
  width: 20%;
  color: #666;
  font-size: 12px;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  text-align: left;
  margin: 0 0 0 30px;
}

.right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 20px;
}
.right p {
  color: #999;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  line-height: 43px;
  margin: 0 15px 0 0;
}

.right button {
  padding: 0 15px;
  height: 30px;
  margin: 6px 5px;
  line-height: 30px;
  font-size: 12px;
  color: #666;
  background-color: #fff;
  border: 1px solid #ccc;
}

.right button:hover {
  background-color: #f3f3f3;
}

.component-table-header {
  width: 1100px;
  margin: 0 auto;
  display: flex;

  border: 1px solid #e4e4e4;
  background-color: #f9fafc;
  height: 45px;
  line-height: 45px;
  padding: 0;
  list-style: none;
  justify-content: space-between;
  box-sizing: border-box;
  border-top: none;
}

.component-table-header li {
  border-top: 1px solid #e4e4e4;
}

.component-table-header li:first-child span {
  border-radius: 5px;
  border: 2px solid #aba2a2;
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 12.5px auto;
  line-height: 16px;
  font-size: 16px;
}

.component-table-header li {
  border-right: 1px solid #e4e4e4;
  font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC";
  font-weight: 650;
  font-style: normal;
  font-size: 14px;
  color: #666666;
}

.component-table-body {
  width: 1100px;
  margin: 0 auto;
  display: flex;
  border: 1px solid #e4e4e4;
  background-color: #fff;
  height: 45px;
  line-height: 45px;
  padding: 0;
  list-style: none;
  justify-content: space-between;
  box-sizing: border-box;
  border-top: none;
}

.component-table-body li {
  font-size: 12px;
  color: #666;
  text-align: center;
  border-right: 1px solid #e4e4e4;
}

.component-table-body li:first-child {
  width: 300px;
}

.component-table-body li:nth-child(2) {
  width: 200px;
}

.component-table-body li:nth-child(3) {
  width: 200px;
}

.component-table-body li:nth-child(4) {
  width: 200px;
}

.component-table-body li:last-child {
  width: 200px;
  border-right: none;
}

.component-table-body li:last-child {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.component-table-body li:last-child a {
  display: inline-block;
  text-align: center;
  color: #1abc9c;
  text-decoration: none;
  font-size: 12px;
  margin-right: 15px;
}
/* 下面都是修改饿了么ui的下拉框和按钮选中后的样式 */

.el-select .el-input.is-focus .el-input__inner,
.el-select .el-input__inner:focus {
  border-color: #e4e4e4;
}

.el-select-dropdown__item.selected {
  color: #666;
  font-weight: 400;
}

.el-select-dropdown {
  min-width: 100px !important;
  top: 50px !important;
  margin-left: 5px;
}
.el-select-dropdown__item {
  height: 26px;
  line-height: 26px;
}

.el-select .el-input__inner {
  width: 100px;
  padding: 0 8px;
  height: 30px;
  margin: 6px 5px;
}

.table {
  width: 1100px;
  margin: 0 auto;
}
</style>






